package com.excuse.excusebuilder.view.activity;

import android.os.Bundle;
import android.support.design.widget.AppBarLayout;
import android.support.v7.widget.Toolbar;
import android.widget.Button;
import android.widget.EditText;

import com.excuse.excusebuilder.R;
import com.excuse.excusebuilder.base.BaseActivity;
import com.excuse.excusebuilder.presenter.AddExcuseActivityPresenter;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

//添加借口Activity
public class AddExcuseActivity extends BaseActivity implements AddExcuseActivityPresenter.IView {
    @BindView(R.id.toolbar)
    Toolbar toolbar;
    @BindView(R.id.app_bar)
    AppBarLayout appBar;
    @BindView(R.id.type_edt)
    EditText typeEdt;
    @BindView(R.id.option_edt)
    EditText optionEdt;
    @BindView(R.id.result_edt)
    EditText resultEdt;
    @BindView(R.id.add_btn)
    Button addBtn;
    private AddExcuseActivityPresenter presenter;

    @Override
    protected void initData() {
        presenter = new AddExcuseActivityPresenter(this, this);
        initToolbar(toolbar, "添加借口");
    }

    @Override
    public int getLayoutResId() {
        return R.layout.activity_add_excuse;
    }



    @OnClick(R.id.add_btn)
    public void onViewClicked() {
        String type=typeEdt.getText().toString().trim();
        String option=optionEdt.getText().toString().trim();
        String result=resultEdt.getText().toString().trim();
        presenter.addExcuse(type,option,result);
    }

    @Override
    public void showRefreshing(boolean isShow) {

    }
}
